<template>
  <div>
    <p>{{ $store.state.username }}</p>
    <p>{{ $store.getters.newName }}</p>
    <button @click="update">1234</button>
  </div>
</template>

<script>
import { useStore } from 'vuex'

export default {
  name: 'App',
  setup() {
    const store = useStore()
    const update = () => {
      console.log(456)
      store.commit('updateName', '12604')
    }

    return {
      update
    }
  }
}
</script>

<style lang="less"></style>
